#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
class Node {
public:
	Node* left;
	Node* right;
	Node* parent;

};
void RotatoR(Node* parent)
{
	Node* subL = parent->left;
	Node* subLR = subL->right;
	Node* parentParent = parent->parent;
	
	if(subLR != nullptr)
	subLR->parent = parent;
	parent->left = subLR;

	parent->parent = subL;
	subL->right = parent;

	if (parentParent == nullptr)
	{
		_root = subL;

	}
	else
	{
		if (parent == parentParent->left)
		{
			parentParent->left = subL;
		}
		else if(parent == parentParent->right)
		{
			parentParent->right = subL;
		}
	}


}